home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / MARBLES.ZIP / MARBLES.POV
Encoding:
Text File  |  1996-11-26  |  5.3 KB  |  139 lines

  1.  
  2. //------------------------------------------------------------------->
  3. //
  4. // marbles.pov - Glass marbles on a wood floor.
  5. //
  6. // Created by: ptdawson@voicenet.com
  7. //
  8. //------------------------------------------------------------------->
  9.  
  10.         #declare Show_Floor = on
  11.         #declare Show_Marbles = on
  12.  
  13.         global_settings { max_trace_level 20 }
  14.  
  15.         #include "colors.inc"
  16.         #include "textures.inc"
  17.         #include "metals.inc"
  18.         #include "glass.inc"
  19.         #include "woods.inc"
  20.         #include "skies.inc"
  21.  
  22.         #default { finish { Shiny } }
  23.         background { White }
  24.  
  25.         #declare R  = seed(111)
  26.         #declare R2 = seed(111)
  27.         #declare R3 = seed(111)
  28.  
  29.         sky_sphere { S_Cloud1 rotate y*180 }
  30.  
  31. //------------------------------------------------------------------->
  32. // Camera.
  33.  
  34.         camera { location < 5, 10, -18 > look_at < 10, 0, -10 > }
  35.  
  36. //------------------------------------------------------------------->
  37. // Lights.
  38.  
  39.         light_source { < -30, 60, -20 > color rgb 2 }
  40.         light_source { <  30, 20, -90 > color rgb 1 }
  41.  
  42. //------------------------------------------------------------------->
  43. // Random short wood pieces.
  44.  
  45. #if ( Show_Floor = on )
  46.  
  47. #debug "Starting wood floor...\n"
  48.  
  49. #declare Z = -20 #while ( Z <= 15 )
  50.         
  51.         #declare X = 0 #while ( X < 35 )
  52.  
  53.                 #declare X2 = X + (rand(R)*3)+1
  54.                 box { < X, -2, Z > < X2 - 0.01, 0, Z+0.99 >
  55.                         
  56.                         #declare TEX = int(rand(R)*35)+1
  57.                         #if(TEX= 1)texture{T_Wood1  rotate y*90}#end
  58.                         #if(TEX= 2)texture{T_Wood2  rotate y*90}#end
  59.                         #if(TEX= 3)texture{T_Wood3  rotate y*90}#end
  60.                         #if(TEX= 4)texture{T_Wood4  rotate y*90}#end
  61.                         #if(TEX= 5)texture{T_Wood5  rotate y*90}#end
  62.                         #if(TEX= 6)texture{T_Wood6  rotate y*90}#end
  63.                         #if(TEX= 7)texture{T_Wood7  rotate y*90}#end
  64.                         #if(TEX= 8)texture{T_Wood8  rotate y*90}#end
  65.                         #if(TEX= 9)texture{T_Wood9  rotate y*90}#end
  66.                         #if(TEX=10)texture{T_Wood10 rotate y*90}#end
  67.                         #if(TEX=11)texture{T_Wood11 rotate y*90}#end
  68.                         #if(TEX=12)texture{T_Wood12 rotate y*90}#end
  69.                         #if(TEX=13)texture{T_Wood13 rotate y*90}#end
  70.                         #if(TEX=14)texture{T_Wood14 rotate y*90}#end
  71.                         #if(TEX=15)texture{T_Wood15 rotate y*90}#end
  72.                         #if(TEX=16)texture{T_Wood16 rotate y*90}#end
  73.                         #if(TEX=17)texture{T_Wood17 rotate y*90}#end
  74.                         #if(TEX=18)texture{T_Wood18 rotate y*90}#end
  75.                         #if(TEX=19)texture{T_Wood19 rotate y*90}#end
  76.                         #if(TEX=20)texture{T_Wood20 rotate y*90}#end
  77.                         #if(TEX=21)texture{T_Wood21 rotate y*90}#end
  78.                         #if(TEX=22)texture{T_Wood22 rotate y*90}#end
  79.                         #if(TEX=23)texture{T_Wood23 rotate y*90}#end
  80.                         #if(TEX=24)texture{T_Wood24 rotate y*90}#end
  81.                         #if(TEX=25)texture{T_Wood25 rotate y*90}#end
  82.                         #if(TEX=26)texture{T_Wood26 rotate y*90}#end
  83.                         #if(TEX=27)texture{T_Wood27 rotate y*90}#end
  84.                         #if(TEX=28)texture{T_Wood28 rotate y*90}#end
  85.                         #if(TEX=29)texture{T_Wood29 rotate y*90}#end
  86.                         #if(TEX=30)texture{T_Wood30 rotate y*90}#end
  87.                         #if(TEX=31)texture{T_Wood31 rotate y*90}#end
  88.                         #if(TEX=32)texture{T_Wood32 rotate y*90}#end
  89.                         #if(TEX=33)texture{T_Wood33 rotate y*90}#end
  90.                         #if(TEX=34)texture{T_Wood34 rotate y*90}#end
  91.                         #if(TEX=35)texture{T_Wood35 rotate y*90}#end
  92.                         
  93.                         // Middle layer.
  94.                         texture {
  95.                         pigment { color rgbf < 1, 1, 1, 0.99 > }
  96.                         finish { Shiny } }
  97.  
  98.                         // Top layer.
  99.                         texture {
  100.                         pigment { color rgbf < 1, 1, 1, 0.99 > }
  101.                         finish { F_MetalE } }
  102.  
  103.                         } // End of box.
  104.  
  105.         #declare X = X2 #end
  106.  
  107. #declare Z = Z + 1 #end
  108.  
  109. #end // End of if block.
  110.  
  111. //------------------------------------------------------------------->
  112. // Glass marbles.
  113.  
  114. #if ( Show_Marbles = on )
  115.  
  116. #debug "Starting glass marbles...\n"
  117.  
  118. #declare X = 0 #while ( X <= 35 )
  119. #declare Z = -20 #while ( Z <= 15 )
  120.         
  121.                 #declare SIZE = (rand(R3)*0.5) + 0.5
  122.  
  123.                 sphere { < X+(rand(R2)*2), SIZE, Z+(rand(R2)*2) >, SIZE
  124.                         finish { F_Glass1 }
  125.                         #declare RRR = (rand(R3)*0.5)+0.5
  126.                         #declare GGG = (rand(R3)*0.5)+0.5
  127.                         #declare BBB = (rand(R3)*0.5)+0.5
  128.                         pigment { color rgbf < RRR, GGG, BBB, 0.95 > } }
  129.  
  130.                 
  131. #declare Z = Z + 3 #end
  132. #declare X = X + 3 #end
  133.  
  134. #end // End of if block.
  135.  
  136. //------------------------------------------------------------------->
  137. // Bye!
  138.  
  139.